package com.example.demo.interceptor;

import org.springframework.context.annotation.Configuration;


import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@Configuration
public class LoginConfig implements WebMvcConfigurer {
    
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //注册TestInterceptor拦截器
        InterceptorRegistration registration = registry.addInterceptor(new Login_Interceptor());
        registration.addPathPatterns("/**");                      //所有路径都被拦截
        registration.excludePathPatterns("/login.html",            //ml静态资源
                 "/User/login"  ,  
                 "/ClientHome/*",   
                 "/Order_Main/save"  ,   
                 "/Food/getlist"  ,   
                 "/FoodType/getlist"  ,   
        		"/**/*.jpg",
        		"/**/*.jpeg",
        		"/**/*.png",
        		"/**/*.js",              //js静态资源
                                         "/**/*.css",             //s静态资源
                                         "/**/*.woff",
                                         "/**/*.ttf"
                                         );    
    }
}

